﻿using System;
using System.Collections.Generic;
using Manager;
using UnityEngine;

// Token: 0x02000258 RID: 600
public class ColorChange
{
	// Token: 0x06000E02 RID: 3586 RVA: 0x000632A8 File Offset: 0x000614A8
	public static void SetHSColor(List<GameObject> lstTarget, global::HSColorSet color, bool chgDif = true, bool chgSpe = true, global::HSColorSet color2 = null, bool chgDif2 = true, bool chgSpe2 = true)
	{
		if (lstTarget.Count == 0)
		{
			return;
		}
		Color white = Color.white;
		if (color2 != null)
		{
			white = new Color(color2.rgbSpecular.r, color2.rgbSpecular.g, color2.rgbSpecular.b, color2.specularSharpness);
		}
		for (int i = 0; i < lstTarget.Count; i++)
		{
			Renderer component = lstTarget[i].GetComponent<Renderer>();
			if (!(null == component))
			{
				Material material = component.material;
				if (chgDif)
				{
					material.SetColor(global::Singleton<Manager.Character>.Instance._Color, color.rgbaDiffuse);
				}
				if (chgSpe)
				{
					material.SetColor(global::Singleton<Manager.Character>.Instance._SpecColor, color.rgbSpecular);
					material.SetFloat(global::Singleton<Manager.Character>.Instance._Metallic, color.specularIntensity);
					material.SetFloat(global::Singleton<Manager.Character>.Instance._Smoothness, color.specularSharpness);
				}
				if (color2 != null)
				{
					if (chgDif2 && material.HasProperty(global::Singleton<Manager.Character>.Instance._Color_3))
					{
						material.SetColor(global::Singleton<Manager.Character>.Instance._Color_3, color2.rgbaDiffuse);
					}
					if (chgSpe2 && material.HasProperty(global::Singleton<Manager.Character>.Instance._SpecColor_3))
					{
						material.SetColor(global::Singleton<Manager.Character>.Instance._SpecColor_3, white);
					}
				}
			}
		}
	}

	// Token: 0x06000E03 RID: 3587 RVA: 0x00063418 File Offset: 0x00061618
	public static void SetHSColor(Material mat, global::HSColorSet color, bool chgDif = true, bool chgSpe = true, global::HSColorSet color2 = null, bool chgDif2 = true, bool chgSpe2 = true)
	{
		if (null == mat)
		{
			return;
		}
		if (chgDif)
		{
			mat.SetColor(global::Singleton<Manager.Character>.Instance._Color, color.rgbaDiffuse);
		}
		if (chgSpe)
		{
			mat.SetColor(global::Singleton<Manager.Character>.Instance._SpecColor, color.rgbSpecular);
			mat.SetFloat(global::Singleton<Manager.Character>.Instance._Metallic, color.specularIntensity);
			mat.SetFloat(global::Singleton<Manager.Character>.Instance._Smoothness, color.specularSharpness);
		}
		if (color2 != null)
		{
			Color color3 = new Color(color2.rgbSpecular.r, color2.rgbSpecular.g, color2.rgbSpecular.b, color2.specularSharpness);
			if (chgDif2 && mat.HasProperty(global::Singleton<Manager.Character>.Instance._Color_3))
			{
				mat.SetColor(global::Singleton<Manager.Character>.Instance._Color_3, color2.rgbaDiffuse);
			}
			if (chgSpe2 && mat.HasProperty(global::Singleton<Manager.Character>.Instance._SpecColor_3))
			{
				mat.SetColor(global::Singleton<Manager.Character>.Instance._SpecColor_3, color3);
			}
		}
	}

	// Token: 0x06000E04 RID: 3588 RVA: 0x00063538 File Offset: 0x00061738
	public static bool CheckChangeSubColor(List<GameObject> lstTarget)
	{
		if (lstTarget.Count == 0)
		{
			return false;
		}
		for (int i = 0; i < lstTarget.Count; i++)
		{
			Renderer component = lstTarget[i].GetComponent<Renderer>();
			if (!(null == component))
			{
				Material material = component.material;
				if (material.HasProperty(global::Singleton<Manager.Character>.Instance._Color_3))
				{
					return true;
				}
			}
		}
		return false;
	}

	// Token: 0x06000E05 RID: 3589 RVA: 0x000635A8 File Offset: 0x000617A8
	public static bool CheckChangeSubColor(Material mat)
	{
		return !(null == mat) && mat.HasProperty(global::Singleton<Manager.Character>.Instance._Color_3);
	}
}
